var root=ui("$");
var nf = sm("do_Notification");
var helperOpen = require("helper/open");
var do_ALayout_comment = ui("do_ALayout_comment");
var do_ImageView_img = ui("do_ImageView_img");
var do_Label_title = ui("do_Label_title");
var labelComment = ui("labelComment");
//图片展示gridView
var do_GridView_1 = ui("do_GridView_1");

//评分展示gridView
var starList = ui("starList");

//设置数据绑定的映射关系
root.setMapping({
	"do_ImageView_img.source":"fullCreatorImg",
	"do_Label_title.text":"creatorName",
	"do_Label_title.tag":"anonymous",
	"do_GridView_1.tag" : "bigImgItems",
	"do_GridView_1.items" : "imgItems",
	"do_GridView_1.visible" : "hasImg",
	"labelComment.text" : "content",
	"do_Label_time.text" : "cnNewAt",
	"starList.tag" : "score"
	
});

root.on("dataRefreshed", function(){
	if(do_Label_title.tag == 1){
		//匿名处理
	}
	var starOn = starList.tag;
	var starListNew = [];
	for(var m=1;m<=5;m++){
		if(m <= starOn){
			starListNew.push({"starImg":"source://image/common/x_01.png"});
		}else{
			starListNew.push({"starImg":"source://image/common/x_02.png"});
		}
	}
	starList.items=starListNew;
});

//图片浏览注册事件
do_GridView_1.on("touch", function(data){
	helperOpen.open("source://view/reuse/imgBrowser.ui", {
		imgDatas :do_GridView_1.tag,index:data
	});
});
